Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Setting Idle Methods

QuickDraw 3D provides a function that you can use to set a view's idle method. QuickDraw 3D executes your idle method occasionally during lengthy operations. See "Application-Defined Routines" for information on writing an idle method.

Your application's callback method may be called during a hardware interrupt, and therefore it should not use Macintosh Toolbox routines. To overcome this limitation, an interrupt-level render completion function can set a global variable, requesting Toolbox calls, that the client polls at noninterrupt time.

Q3View_SetIdleMethod

You can use the Q3View_SetIdleMethod function to set a view's idle method.

TQ3Status Q3View_SetIdleMethod (
                     TQ3ViewObject view,
                     TQ3ViewIdleMethod idleMethod,
                     const void *idlerData);
view
A view.
idleMethod
A pointer to an idle method.
idlerData
A pointer to an application-defined block of data. This pointer is passed to the idle method when it is executed.

DESCRIPTION

The Q3View_SetIdleMethod function sets the idle method of the view specified by the view parameter to the function specified by the idleMethod parameter. The idlerData parameter is passed to your callback routine whenever it is executed.

SPECIAL CONSIDERATIONS

Because your callback function may be called at hardware interrupt level, be careful about using Macintosh Toolbox routines. To call the Toolbox, you may want to set a global variable that you can later poll at noninterrupt level.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |